<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
// use Illuminate\Database\Eloquent\SoftDeletes;

class AdminRole extends Model
{
    // use SoftDeletes;

    protected $table = 'admin_role';
    protected $primaryKey = 'id';
    // protected $dates = ['deleted_at'];

    protected $fillable = [
    	'title', 'description', 'status'
    ];

    public function users()
    {
        return $this->belongsToMany('App\Models\AdminUser', 'admin_user_role', 'admin_role_id', 'admin_user_id');
    }

    //多对多角色菜单
    public function menus()
    {
        return $this->belongsToMany('App\Models\AdminMenu', 'admin_role_menu', 'admin_role_id', 'admin_menu_id');
    }
}
